# Maintainer: Filipe Laíns (FFY00) <lains@archlinux.org>
# Contributor: David Rodriguez <dissonant.tech@gmail.com>

pkgname=lightdm-webkit-theme-archlinux
_commit=5bab408a49a339fa4b9cb58672fc50bf7a16b906
pkgver=0.5.0.r35.5bab40
_bgver=0.7
pkgrel=1
pkgdesc="ArchLinux version of the official Antergos greeter"
arch=('any')
url='https://github.com/Dissonant-Tech/lightdm-webkit-theme-archlinux'
license=('GPL2')
depends=('lightdm' 'lightdm-webkit2-greeter')
source=("$pkgname-$pkgver.tar.gz::$url/archive/$_commit.tar.gz"
        "http://antergos.com/antergos-wallpapers-$_bgver.zip")
sha512sums=('3b1e9f10246294446b6c70bb83fc5d7c016444849d5e39bdb7a60085e57ee66f81b5eaf0892122694bd40a4c00a71dfe33b2b8eb0773dd107048529f76c556f6'
            'b5c051b432d5e8d0ebb4870a11b1de63a46cd3c14853e03fe63f429f03e6838b92606b8f0365dcea7f9ab5ca1d67503b1839caf86f4684025d5b4933aca090ca')

prepare() {
  cd $pkgname-$_commit

  sed -i 's|/usr/share/|/usr/share/lightdm-webkit/themes/|g' index.html
}

package() {
  _themedir="$pkgdir"/usr/share/lightdm-webkit/themes/archlinux

  # Install theme
  install -dm 755 "$_themedir"
  cp -dpr --no-preserve=ownership $pkgname-$_commit/* "$_themedir"

  # Instal wallpapers
  install -dm 755 "$_themedir"/wallpapers
  cp -dpr --no-preserve=ownership antergos-wallpapers-$_bgver "$_themedir"/wallpapers
}

